<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class RegSuccNotify implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $email;
    protected $username;

    public function __construct($email,$username)
    {
        $this->email = $email;
        $this->username = $username;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
		$content = [
			'username'=>$this->username,
		];

		\Mail::send('email_tpl.reg_success_email',$content,function ($message){
			$message->to($this->email)->subject('【CLANNAD商城】恭喜您，注册成功');
		});
    }
}
